<template>
  <min-dialog-box :dialogData="dialogData" v-if="showDialog" @submitBtnEvent="operation">

  </min-dialog-box>
</template>

<script>
export default {
  data () {
    return {}
  },
  computed: {
    // 是否显示弹框
    showDialog () {
      return this.$store.state.conferenceRoom.cf_notification
    },
    // 弹窗内容
    dialogData () {
      if (this.showDialog === 1) {
        return {
          mainTips: ['您已被设为主持人'],
          btnList: [{
            name: '知道了',
            color: 'blue',
            type: 'submit'
          }]
        }
      } else if (this.showDialog === 2) {
        return {
          mainTips: ['主持人已结束会议'],
          btnList: [{
            name: '知道了',
            color: 'blue',
            type: 'submit'
          }]
        }
      } else {
        return {
          mainTips: ['主持人已将您移出会议'],
          btnList: [{
            name: '知道了',
            color: 'blue',
            type: 'submit'
          }]
        }
      }
    }
  },
  methods: {
    // 点击知道了的操作
    operation () {
      if (this.showDialog === 1) {
        this.$store.commit('conferenceRoom/set_cf_notification', null)
      } else if (this.showDialog === 2 || this.showDialog === 3) {
        this.$store.commit('conferenceRoom/reset_state')
        this.$router.push('/conference/agendaCf/main')
      }
    }
  }
}
</script>

<style scoped lang="scss">

</style>
